
package com.springboot.redis;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import com.springboot.mybatis.example.domain.User;
import com.springboot.mybatis.example.utils.RedisComponent;

/**
 * create by: 玉米
 * description:redis 测试类
 * create time: 16:42 2018/12/20
 *
  * @Param: null
 * @return
 */
@SpringBootTest
public class SpringbootSentinelredisApplicationTests {

    @Autowired
    private RedisComponent redisComponet;

    @Test
    public void sentinelSet(){
        User user = new User();
        user.setId(11);
        user.setAge(40);
        user.setUserName("狗蛋");

        redisComponet.sentinelSet(user);
    }

    @Test
    public void sentinelGet(){
        String str = redisComponet.get("0002");
        System.out.println(str);
    }

    @Test
    public void sentineldel(){
        redisComponet.del("11");

    }

}

